package client;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintStream;
import java.net.Socket;
import java.net.UnknownHostException;


public class IFMSocketCliente extends Thread {

    private Socket socket;
    private static String nomeCliente;

    public IFMSocketCliente(Socket socket){
        this.socket = socket;
    }

    public static Socket criaConexao(String ip) throws UnknownHostException, IOException{
        Socket socket = new Socket(ip,7001);
        return socket;
    }

    public static void setNomeCliente(String nome){
        nomeCliente = nome;
    }

    @Override
    public void run(){
        try{
            TratadorDeString.recebeString(socket);
        }
        catch (IOException e) {
            System.out.println("Ocorreu uma Falha... .. ." + " IOException: " + e);
        }

    }


}
